package application;

import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javax.swing.JButton;
import javax.swing.SwingUtilities;

/**
 * 测试将Swing组件转换成JavaFX 
 * @author qxgw
 *
 */
public class Main7 extends Application {
	@Override
	public void start(Stage stage) {
		final SwingNode swingNode = new SwingNode();
		//createSwingContent(swingNode);
		SwingUtilities.invokeLater(() -> {
			swingNode.setContent(new JButton("Click me"));
		});
		StackPane pane = new StackPane();
		pane.getChildren().add(swingNode);

		stage.setTitle("Swing in JavaFX");
		stage.setScene(new Scene(pane, 250, 150));
		stage.show();

	}

	public static void mian(String[] args){
		launch(args);
	}
	
}
